
//preloading.....
load("library/common.js");

JEuler.system.loadJS("library/math.js");

(function() {

    //JEuler.system.loadJS("data/???.dat");
    JEuler.system.printCaption("69");
    JEuler.system.startTimerCount();
    
    //1,000,000
    //We could know that
    // phi(n) = n*(1-p1)*(1-p2)*....*(1-pn)
    //   where p1,..,pn is prime factor of n
    
    // so ....
    
    JEuler.math.PrimeUtils.sievePrime(1000);
    var primes = JEuler.math.PrimeUtils.getPrimePool();
    var n = 1, i=0;
    
    do {
        n = n*primes[i];
        i++;
    } while (n<1000000)
    
    JEuler.system.print("N = " + n/primes[i-1]);
    
    JEuler.system.printTimerCount();
    
})();
